import request from '@/utils/request'

// 查询数据源信息列表 
export function listDatasourceInfo(data) {
  return request({
    url: '/console/datasourceInfo/list',
    method: 'post',
    data: data
  })
}

// 查询数据源信息详细
export function getDatasourceInfo(data) {
  return request({
    url: '/console/datasourceInfo/getInfo',
    method: 'post',
    data: data
  })
}

// 新增数据源信息
export function addDatasourceInfo(data) {
  return request({
    url: '/console/datasourceInfo/add',
    method: 'post',
    data: data
  })
}

// 修改数据源信息
export function updateDatasourceInfo(data) {
  return request({
    url: '/console/datasourceInfo/edit',
    method: 'post',
    data: data
  })
}

// 删除数据源信息
export function delDatasourceInfo(data) {
  return request({
    url: '/console/datasourceInfo/remove',
    method: 'post',
    data: data
  })
}

// 测试 数据源接口

export function databaseCheck(data) {
  return request({
    url: '/console/datasourceInfo/databaseCheck',
    method: 'post',
    data: data
  })
}

// listDatabase  ---数据库列表
export function databaseListData(data) {
  return request({
    url: '/console/datasourceInfo/listDatabase',
    method: 'post',
    data: data
  })
}

// listDatabase  ---对象列表
export function databaseListObjects(data) {
  return request({
    url: '/console/datasourceInfo/listObjects',
    method: 'post',
    data: data
  })
}
// listDatabase  ---对象列表
export function databaseListTables(data) {
  return request({
    url: '/console/datasourceInfo/listTables',
    method: 'post',
    data: data
  })
}

export function databaseExecuteSql(data) {
  return request({
    url: '/console/datasourceInfo/executeSql',
    method: 'post',
    data: data
  })
}

export function databaseListColumns(data) {
  return request({
    url: '/console/datasourceInfo/listColumns',
    method: 'post',
    data: data
  })
}

export function databaseListDbColumns(data) {
  return request({
    url: '/console/datasourceInfo/listDbColumns',
    method: 'post',
    data: data
  })
}

export function databaseListDatabaseAndSchema(data) {
  return request({
    url: '/console/datasourceInfo/listDatabaseAndSchema',
    method: 'post',
    data: data
  })
}

export function getListConfigDbTypes(data) {
  return request({
    url: '/console/datasourceInfo/listConfigDbTypes',
    method: 'post',
    data: data
  })
}




